package com.sdx.console.spread.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ibeetl.admin.core.entity.BaseEntity;
import com.sdx.common.utils.Utils;
import lombok.Data;
import org.beetl.sql.core.annotatoin.ColumnIgnore;

import java.util.Date;

/**
 * @ClassName SpreadShare
 * @Description
 * @Author kangbin
 * @Date 2020/3/20 16:04
 */
@Data
@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
public class SpreadShare extends BaseEntity {

    private String customerId;

    //推广码
    private String promoteCode;

    private Integer tenantId;

    //渠道码
    private String channelCode;

    //渠道名称
    private String channelName;

    private String phone;
    //佣金
    private Long commissionMoney;

    //订单数
    private Long total;

    // 订单总额
    private Long totalMoney;

    //提现金额
    private Long withdrawAmount;

    //提现时间
    private Date withdrawTime;

    private Long commissionMoneyStart;
    private Long commissionMoneyEnd;

    private Integer totalStart;
    private Integer totalEnd;

    private Long totalMoneyStart;
    private Long totalMoneyEnd;

    private Long withdrawAmountStart;
    private Long withdrawAmountEnd;

    private String withdrawTimeQuery;

    private Date withdrawTimeStart;

    private Date withdrawTimeEnd;
    public String getWithdrawTimeQuery(){
        return  withdrawTimeQuery;
    }
    public void setWithdrawTimeQuery(String withdrawTimeQuery ){
        this.withdrawTimeQuery = withdrawTimeQuery;
        Date[] timePair = Utils.parseQueryTime(withdrawTimeQuery);
        if (timePair!=null && timePair[0]!=null) {
            this.withdrawTimeStart = timePair[0];
        }
        if (timePair!=null && timePair.length==2 && timePair[1]!=null) {
            this.withdrawTimeEnd = timePair[1];
        }
    }
}
